package com.betterjr.modules.risk.loan.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TransactionDTO implements Serializable {

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");

    /** 
     * @Fields serialVersionUID :  
     */
    private static final long serialVersionUID = 2011098036758201398L;

    // 交易数据id
    private String id;

    // 供应商名称
    private String supplierName;

    // 供应商代码
    private String supplierCode;

    // 核心企业编号
    private String enterId;

    // 核心企业名称
    private String enterpriseName;

    // 资金方编号
    private String fundId;

    // 资金方名称
    private String fundName;

    // 应付金额
    private BigDecimal tradeMoney;

    // 应付日期
    private Date tradeDate;

    private String payDate;

    // 订单编号
    private String orderNo;

    // 贸易合同编号
    private String contractNo;

    // 发票号码
    private String receiptNo;

    // 发票金额
    private BigDecimal receiptMoney;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getEnterId() {
        return enterId;
    }

    public void setEnterId(String enterId) {
        this.enterId = enterId;
    }

    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    public String getFundId() {
        return fundId;
    }

    public void setFundId(String fundId) {
        this.fundId = fundId;
    }

    public String getFundName() {
        return fundName;
    }

    public void setFundName(String fundName) {
        this.fundName = fundName;
    }

    public BigDecimal getTradeMoney() {
        return tradeMoney;
    }

    public void setTradeMoney(BigDecimal tradeMoney) {
        this.tradeMoney = tradeMoney;
    }

    public Date getTradeDate() {
        return tradeDate;
    }

    public void setTradeDate(Date tradeDate) {
        this.tradeDate = tradeDate;
    }

    public String getPayDate() {
        return sdf.format(tradeDate);
    }

    public void setPayDate(String payDate) {
        this.payDate = payDate;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getContractNo() {
        return contractNo;
    }

    public void setContractNo(String contractNo) {
        this.contractNo = contractNo;
    }

    public String getReceiptNo() {
        return receiptNo;
    }

    public void setReceiptNo(String receiptNo) {
        this.receiptNo = receiptNo;
    }

    public BigDecimal getReceiptMoney() {
        return receiptMoney;
    }

    public void setReceiptMoney(BigDecimal receiptMoney) {
        this.receiptMoney = receiptMoney;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((contractNo == null) ? 0 : contractNo.hashCode());
        result = prime * result + ((enterId == null) ? 0 : enterId.hashCode());
        result = prime * result + ((enterpriseName == null) ? 0 : enterpriseName.hashCode());
        result = prime * result + ((fundName == null) ? 0 : fundName.hashCode());
        result = prime * result + ((fundId == null) ? 0 : fundId.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((orderNo == null) ? 0 : orderNo.hashCode());
        result = prime * result + ((payDate == null) ? 0 : payDate.hashCode());
        result = prime * result + ((receiptMoney == null) ? 0 : receiptMoney.hashCode());
        result = prime * result + ((receiptNo == null) ? 0 : receiptNo.hashCode());
        result = prime * result + ((sdf == null) ? 0 : sdf.hashCode());
        result = prime * result + ((supplierCode == null) ? 0 : supplierCode.hashCode());
        result = prime * result + ((supplierName == null) ? 0 : supplierName.hashCode());
        result = prime * result + ((tradeDate == null) ? 0 : tradeDate.hashCode());
        result = prime * result + ((tradeMoney == null) ? 0 : tradeMoney.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof TransactionDTO)) {
            return false;
        }
        TransactionDTO other = (TransactionDTO) obj;
        if (contractNo == null) {
            if (other.contractNo != null) {
                return false;
            }
        } else if (!contractNo.equals(other.contractNo)) {
            return false;
        }
        if (enterId == null) {
            if (other.enterId != null) {
                return false;
            }
        } else if (!enterId.equals(other.enterId)) {
            return false;
        }
        if (enterpriseName == null) {
            if (other.enterpriseName != null) {
                return false;
            }
        } else if (!enterpriseName.equals(other.enterpriseName)) {
            return false;
        }
        if (fundName == null) {
            if (other.fundName != null) {
                return false;
            }
        } else if (!fundName.equals(other.fundName)) {
            return false;
        }
        if (fundId == null) {
            if (other.fundId != null) {
                return false;
            }
        } else if (!fundId.equals(other.fundId)) {
            return false;
        }
        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }
        if (orderNo == null) {
            if (other.orderNo != null) {
                return false;
            }
        } else if (!orderNo.equals(other.orderNo)) {
            return false;
        }
        if (payDate == null) {
            if (other.payDate != null) {
                return false;
            }
        } else if (!payDate.equals(other.payDate)) {
            return false;
        }
        if (receiptMoney == null) {
            if (other.receiptMoney != null) {
                return false;
            }
        } else if (!receiptMoney.equals(other.receiptMoney)) {
            return false;
        }
        if (receiptNo == null) {
            if (other.receiptNo != null) {
                return false;
            }
        } else if (!receiptNo.equals(other.receiptNo)) {
            return false;
        }
        if (sdf == null) {
            if (other.sdf != null) {
                return false;
            }
        } else if (!sdf.equals(other.sdf)) {
            return false;
        }
        if (supplierCode == null) {
            if (other.supplierCode != null) {
                return false;
            }
        } else if (!supplierCode.equals(other.supplierCode)) {
            return false;
        }
        if (supplierName == null) {
            if (other.supplierName != null) {
                return false;
            }
        } else if (!supplierName.equals(other.supplierName)) {
            return false;
        }
        if (tradeDate == null) {
            if (other.tradeDate != null) {
                return false;
            }
        } else if (!tradeDate.equals(other.tradeDate)) {
            return false;
        }
        if (tradeMoney == null) {
            if (other.tradeMoney != null) {
                return false;
            }
        } else if (!tradeMoney.equals(other.tradeMoney)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "TransactionDTO [sdf=" + sdf + ", id=" + id + ", supplierName=" + supplierName + ", supplierCode="
                + supplierCode + ", enterId=" + enterId + ", enterpriseName=" + enterpriseName + ", fundId=" + fundId
                + ", fundName=" + fundName + ", tradeMoney=" + tradeMoney + ", tradeDate=" + tradeDate + ", payDate="
                + payDate + ", orderNo=" + orderNo + ", contractNo=" + contractNo + ", receiptNo=" + receiptNo
                + ", receiptMoney=" + receiptMoney + "]";
    }

}
